package com.example.demo.commom;

import com.example.demo.entity.Topic;

import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-10-12
 * Time:17:00
 */
public class ProcessString {
    public static HashMap<String,Object> processString(Topic topic) {
        HashMap<String,Object> map = new HashMap<>();
        map.put("topic",topic);
        String describe = topic.getDescription();
        String[] descArr = describe.split("\\$",4);
        map.put("list1",descArr[0]);
        map.put("list2",descArr[1]);
        map.put("list3",descArr[2]);
        map.put("list4",descArr[3]);
        return map;
    }
}
